<template>
	<view class="app">
		<view class="uni-swipe" v-for="(item, index) in proList" :key="index">
			<view class="uni-swipe_content">
				<view class="uni-swipe_move-box" style="position:relative;">
					<view class="item row">
						<text class="mix-icon icon-xuanzhong"></text>
						<view class="image-wrapper lazypic">
							<image :src="item['imglist'][0]" mode="aspectFill"></image>
						</view>
						<view class="right column">
							<text class="title clamp">{{ item.name}}</text>
							<text class="sku">{{ item.typename}}</text>
							<text class="price">¥{{ item.money }}</text>
							<view class="number-box">
								<view class="uni-numbox">
									<view class="uni-numbox-minus">
										<text class="mix-icon icon--jianhao uni-numbox-disabled"></text>
									</view>
									<input class="uni-numbox-value" type="number" value="1">
									<view class="uni-numbox-plus">
										<text class="mix-icon icon-jia2"></text>
									</view>
								</view>
							</view>
						</view>
					</view>
				</view>
			</view>
		</view>

		<view class="invalid">
			<view class="invalid-header row">
				<text class="mix-icon icon-tishi"></text>
				<text class="fill">商品调整、库存不足等原因会导致商品失效</text>
				<view class="btn center">
					<text class="mix-icon icon-lajitong"></text>
					<text>清除</text>
				</view>
			</view>
			
			<view class="item row" v-for="(item, index) in proList" :key="index">
				<text class="mix-icon icon-xuanzhong"></text>
				<view class="image-wrapper lazypic">
					<image :src="item['imglist'][0]" mode="aspectFill"></image>
				</view>
				<view class="right column">
					<text class="title clamp">{{ item.name}}</text>
					<text class="sku">{{ item.typename}}</text>
					<view class="row">
						<text class="price fill">¥{{ item.money }}</text>
						<view class="tag">产品失效</view>
					</view>
				</view>
			</view>	
		</view>


		<view class="bottom row">
			<text class="mix-icon icon-xuanzhong active"></text>
			<text class="check-tip">全选</text>
			<view class="del-btn center active">
				<text>清空</text>
			</view>
			<text class="price fill">￥213.45</text>
			<view class="btn center" @click="setorder()">
				<text>去结算(7)</text>
			</view>
		</view>
		
		<view class="get20vw"></view>
	</view>
</template>

<script>
	export default {
		components: {
		},
		data() {
			return {
				proList: [],
			}
		},
		onLoad() {
			let that = this;
			that.proList = that.globals.proList;
			console.log('产品数据', that.proList);
		},
		methods: {
			// ----- 跳转订单 ----
			setorder() {
				let url = '/pages/order/setorder';
				this.navTo(url);
			},
		}
	}
</script>

<style>
	.uni-numbox {
		display: flex;
		justify-content: flex-start;
		flex-direction: row;
		align-items: center;
		height: 50rpx;
	}

	.uni-numbox-minus,
	.uni-numbox-plus {
		display: flex;
		align-items: center;
		justify-content: center;
		width: 50rpx;
		height: 100%;
		line-height: 1;
		background-color: #f7f7f7;
	}

	.uni-numbox-minus .mix-icon,
	.uni-numbox-plus .mix-icon {
		font-size: 32rpx;
		color: #333;
	}

	.uni-numbox-value {
		display: flex;
		align-items: center;
		justify-content: center;
		background-color: #fff;
		width: 60rpx;
		height: 50rpx;
		min-height: 50rpx;
		text-align: center;
		font-size: 28rpx;
		color: #333;
	}

	.uni-numbox-disabled.mix-icon {
		color: #C0C4CC;
	}
</style>



<style scoped lang="scss">
	.app {

		/deep/ .uni-swipe {
			padding: 24rpx 0;
		}
	}

	.item {
		width: 100%;
		padding-right: 30rpx;
		overflow: hidden;

		.icon-xuanzhong {
			padding: 60rpx 20rpx;
			font-size: 36rpx;
			color: #ddd;

			&.active {
				color: $base-color;
			}
		}

		.image-wrapper {
			flex-shrink: 0;
			width: 170rpx;
			height: 170rpx;
			margin-right: 20rpx;
			border-radius: 10rpx;
			overflow: hidden;

			image {
				width: 100%;
				height: 100%;
			}
		}

		.right {
			flex: 1;
			overflow: hidden;
		}

		.title {
			font-size: 30rpx;
			line-height: 42rpx;
		}

		.sku {
			min-height: 20rpx;
			margin: 20rpx 0 28rpx;
			font-size: 24rpx;
			color: #999;
		}

		.price {
			margin-bottom: 4rpx;
			font-size: 30rpx;
			color: #333;
		}

		.number-box {
			position: absolute;
			right: 0;
			bottom: 0;
			padding: 20rpx 30rpx 0;
		}

		/deep/ {
			.uni-numbox-minus,
			.uni-numbox-value,
			.uni-numbox-plus {
				height: 48rpx;
			}
		}
	}

	.invalid {

		.item {
			padding: 24rpx 24rpx 24rpx 0;
			opacity: 0.5;
		}

		.invalid-header {
			height: 72rpx;
			padding: 0 24rpx 0 22rpx;
			font-size: 24rpx;
			color: #333;
			background-color: #f5f5f5;
		}

		.icon-tishi {
			margin-right: 10rpx;
			font-size: 32rpx;
			color: $base-color;
		}

		.btn {
			padding: 8rpx 16rpx;
			font-size: 24rpx;
			color: #666;
		}

		.icon-lajitong {
			margin-right: 8rpx;
			font-size: 32rpx;
		}

		.tag {
			padding: 6rpx 18rpx;
			font-size: 24rpx;
			color: #fff;
			border-radius: 100rpx;
			background-color: #555;
		}
	}

	.bot-fill-view {
		width: 100%;
		height: 110rpx;
		box-sizing: content-box;
		padding-bottom: constant(safe-area-inset-bottom);
		padding-bottom: env(safe-area-inset-bottom);
	}

	.bottom {
		position: fixed;
		left: 0;
		bottom: var(--window-bottom);
		z-index: 90;
		width: 100%;
		height: 100rpx;
		background-color: #fff;
		box-shadow: 0 -2rpx 10rpx 0 rgba(0, 0, 0, .06);
		box-sizing: content-box;
		padding-bottom: constant(safe-area-inset-bottom);
		padding-bottom: env(safe-area-inset-bottom);

		.icon-xuanzhong {
			margin-left: 20rpx;
			font-size: 48rpx;
			color: #ddd;
			position: relative;
			z-index: 10;
			background-color: #fff;
			border-radius: 100rpx;

			&.active {
				color: $base-color;
			}
		}

		.check-tip {
			position: absolute;
			left: 80rpx;
			font-size: 28rpx;
			color: #333;
		}

		.del-btn {
			width: 0rpx;
			height: 44rpx;
			padding-left: 14rpx;
			font-size: 28rpx;
			color: #fff;
			background-color: #C0C4CC;
			border-radius: 0 100rpx 100rpx 0;
			position: relative;
			left: -24rpx;
			transition: width .2s;

			&.active {
				width: 110rpx;
			}
		}

		.price {
			margin-right: 30rpx;
			font-size: 34rpx;
			color: $base-color;
			font-weight: 700;
			text-align: right;
		}

		.btn {
			min-width: 180rpx;
			height: 70rpx;
			padding: 0 26rpx;
			margin-right: 20rpx;
			border-radius: 100rpx;
			background-color: $base-color;
			font-size: 30rpx;
			color: #fff;
		}
	}
</style>
